import { httprequests } from '@/miniprogram/utils/httpReq'

//购物车提交订单的请求
export const orderconfirm = () => {
   return httprequests('oms-order/OrderConfirm', 'POST')
}

//立即购买订单确认请求
export const orderconfirmBuyNow = (data) => {
   return httprequests('oms-order/OrderConfirmBuyNow', 'GET', {
      skuId: data.skuId,
      count: data.count
   })
}

export const deleteOrder = (data) => {
   return httprequests('oms-order/deleteOrderbyorderSn', 'GET', {
      orderSn: data.orderSn
   })
}



/**
 * 
 * @param {
 * addrId:data.addrId,
    payType:data.payType,
    orderToken:data.orderToken,
    payPrice:data.payPrice,
    note:data.note
} data 
 */
export const orderSubmit = (data) => {
   return httprequests('oms-order/orderSubmit', 'POST', data)
}
///oms-order/orderSubmit


/**
 * 货物邮费信息
   params:'addrId'
 */
export const getpostAges = (data) => {
   console.log(data);
   return httprequests('wms-ware-info/getPostAge', 'POST', data)
}
//查询物流公司列表
export const getExpressListFun = () => {
   return httprequests('/wms-express-company-manage/getexpressList', 'GET')
}

//获取当前支付订单

export const getorderByorderSn = (data) => {
   return httprequests('oms-order/getorderByorderSn', 'GET', {
      orderSn: data.orderSn
   })
}


//获取订单列表

export const getOrderList = (data) => {
   return httprequests('oms-order/OrderList', 'GET', {
      currentPage: data.currentPage,
      pageSize: data.pageSize,
      sort: data.sort
   })
}


/**
 * 客户催单
 * customerReminder
   / confirmdeliveryDone
   / cancelOrderByCustomer
*/
/**
 * 
 * @param {催单}} data 
 */
 export const customerReminder = (data)=>{
    return httprequests('oms-order/customerReminder','POST',{
       orderSn:data.orderSn,
       reason:data.remindValue
    })
 }

 /**
  * 
  * @param {确认收货} data 
  */
 export const confirmdeliveryDone = (data) =>{
    return httprequests('oms-order/confirmdeliveryDone','GET',{
       orderSn:data.orderSn
    })
 }

 /**
  * 
  * @param {取消订单} data 
  */
 export const cancelOrderByCustomer = (data) =>{
    return httprequests('oms-order/cancelOrderByCustomer','POST',data)
 }

/**
 * 
 * @param {用户评价} data 
 */
 export const memberAfterCommens = (data)=>{
    return httprequests('ums-comment/memberAfterCommens','POST',data)
 }

/**
 * 
 * @param {订单综合评分} data 
 */
 export const combinedScoreByCustomor = (data) =>{
    return httprequests('oms-order/combinedScoreByCustomor','GET',{
       orderSn:data.orderSn,
       combinedScore:data.combinedScore
    })
 }